package com.emergency.evaluate.dao;


import com.emergency.evaluate.domain.Auto;
import com.emergency.evaluate.domain.Manual;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Administrator on 2020/3/16.
 */
public interface AutoDao extends JpaRepository<Auto,String>, JpaSpecificationExecutor<Auto> {

     //根据想定编号查询系统评分表
    @Query("select a from Auto a where scenar.id=:scenarId")
    List<Auto> findAllByScenar(@Param ( "scenarId" ) Long scenarId);
     //根据系统评分表ID删除评分表
     void deleteById(Long id);
     //根据系统评分表编号查询系统评分表
    @Query(value = "SELECT  a from Auto a WHERE a.id =:id ")
    Auto findAllById(@Param ( "id" ) Long id);
    //找到与plan对应的评分表
    @Query(value = "select  a from Auto a where a.id=:id")
    List<Auto> findallById(@Param ( "id" ) Long id);
}
